package com.awifi.demo.requestParam;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

/**
 * @description: ToDo
 * @author: marin
 * @time: 2020/8/14 17:19
 */

@RestController
@RequestMapping("/param")
@Slf4j
public class RequestParamController {

    @GetMapping("/test1")
    public String testParam1(@RequestParam(value = "params") String body) {
        log.info("test1,params:{}",body);
        return body;
    }

    @GetMapping("/test2")
    public String testParam2(@RequestBody String body) {
        log.info("test2,params:{}",body);
        return body;
    }


    @PostMapping("/test3")
    public String testParam3(@RequestBody String body) {
        log.info("test3,params:{}",body);
        return body;
    }

    @PostMapping("/test4")
    public String testParam4(@RequestParam("params") String body) {
        log.info("test4,params:{}",body);
        return body;
    }

    @PutMapping("/test5")
    public String testParam5(@RequestParam("params") String body) {
        log.info("test5,params:{}",body);
        return body;
    }

    @PutMapping("/test6")
    public String testParam6(@RequestBody String body) {
        log.info("test6,params:{}",body);
        return body;
    }

    @DeleteMapping("/test7")
    public String testParam7(@RequestParam("params") String body) {
        log.info("test7,params:{}",body);
        return body;
    }

    @DeleteMapping("/test8")
    public String testParam8(@RequestBody String body) {
        log.info("test8,params:{}",body);
        return body;
    }

}
